home *** CD-ROM | disk | FTP | other *** search
/ Online Today 2000 January / Onto0100.iso / pc / Browser / Web-Fix / Web-Fix Installer.exe / Main / UploadTool.wfp < prev    next >
Encoding:
Text File  |  1999-09-08  |  3.9 KB  |  159 lines

  1. module oWF_UploadToolPlugin is cWF_PluginList
  2. ---------------------------------------------
  3. with
  4.     Items is [
  5.         oWF_UploadTool
  6.     ];
  7. end;
  8.  
  9. object oWF_UploadTool is cWF_UploadPlugin
  10. has
  11.     ActivateTool()
  12.     do
  13.         self.SinglePageFlag := false;
  14.         self.DeleteFlag := true;
  15.     end;
  16.     
  17.     DoUpload()
  18.     do
  19.         -- Projekt gewèhlt?
  20.         if (oWF_Main.PageManager.ActiveProject <> void) then
  21.             if (self.IsUserDataOK()) then
  22.                 -- Wenn das gesamte Projekt gespeichert wird, warne wenn keine Startseite gesetzt ist
  23.                 if ((oWF_Main.PageManager.ActiveProject.GetStartPage() = void) and not(self.SinglePageFlag)) then
  24.                     oWF_Main.Message(self, DoUpload_OK1, self, DoUpload_Cancel, 2606);
  25.                 else
  26.                     self.DoUpload_OK1();
  27.                 end;
  28.             else
  29.                 oWF_Main.Alert(2603, self.ErrorMessage);
  30.                 self.ErrorMessage := "";
  31.             end;
  32.         else
  33.             oWF_Main.Alert(2705);
  34.         end;
  35.     end;
  36.     
  37.     DoUpload_Cancel()
  38.     do
  39.     end;
  40.     
  41.     DoUpload_OK1()
  42.     use
  43.         aStartPage;
  44.         aReport;
  45.         aDeleteWarning;
  46.         aServer; aPath; aUser; aCode;
  47.     do
  48.         if (self.SinglePageFlag) then
  49.             aStartPage := oWF_Main.HTMLManager.PrepareUploadCurrentPage();
  50.         else
  51.             aStartPage := oWF_Main.HTMLManager.PrepareUploadCurrentProject();
  52.         end;
  53.         -- Fehler beim Speichern?
  54.         if not(aStartPage = void) then
  55.             if (self.DeleteFlag) then
  56.                 aDeleteWarning := oWF_Main.GetText(2608, (oWF_Main.GetText(2602))) + "\$0D\$0D";
  57.             else
  58.                 aDeleteWarning := "";
  59.             end;
  60.             aServer := self.GetServer();
  61.             aPath := self.GetServerPath();
  62.             if (aPath.Count() = 0) then
  63.                 aPath := oWF_Main.GetText(2609);
  64.             end;
  65.             aUser := self.GetUserName();
  66.             if (aUser.Count() = 0) then
  67.                 aPath := oWF_Main.GetText(2609);
  68.             end;
  69.             aCode := oWF_Main.IfVoid(self.UserCode, "");
  70.             if (aCode.Count() = 0) then
  71.                 aCode := oWF_Main.GetText(2609);
  72.             end;
  73.             aReport := oWF_Main.GetText(2607, aServer, aPath, aUser, aCode, aDeleteWarning);
  74.             oWF_Main.Message(self, DoUpload_OK2, self, DoUpload_Cancel, aReport);
  75.         end;
  76.     end;
  77.     
  78.     DoUpload_OK2()
  79.     do
  80.         oWF_Main.HTMLManager.LaunchUpload(self);
  81.     end;
  82.     
  83.     -------------------------
  84.     -- Benutzerdaten-Kontrolle
  85.     -------------------------
  86.     
  87.     ErrorMessage;
  88.     
  89.     IsServerOK()
  90.     do
  91.         result := false;
  92.         if ((self.GetServer()).Count() = 0) then
  93.             self.ErrorMessage := oWF_Main.GetText(2604) + "\$0D\$0D";
  94.         else if (oKR_String.CountChar((self.GetServer()), '.') < 2) then
  95.             self.ErrorMessage := oWF_Main.GetText(2605) + "\$0D\$0D";
  96.         else
  97.             result := true;
  98.         end;
  99.     end;
  100.     
  101.     IsServerPathOK()
  102.     do
  103.         result := true;
  104.     end;
  105.     
  106.     IsUserCodeOK()
  107.     do
  108.         result := true;
  109.     end;
  110.     
  111.     IsUserNameOK()
  112.     do
  113.         result := true;
  114.     end;
  115.     
  116.     IsUserDataOK()
  117.     do
  118.         self.ErrorMessage := "";
  119.         result := (self.IsServerOK() and self.IsServerPathOK() and self.IsUserCodeOK() and self.IsUserNameOK());
  120.     end;
  121. with
  122.     ErrorMessage is "";
  123.     ParameterList        is [
  124.                                 [oP_Boolean, 2702, GetSinglePageFlag, SetSinglePageFlag],
  125.                                 [oP_Boolean, 2602, GetDeleteFlag, SetDeleteFlag],
  126.                                 [oP_Boolean, 2611, GetHTMLExtensionFlag, SetHTMLExtensionFlag],
  127.                                 [oP_Separator],
  128.                                 [oP_Text200, 2901, GetServer, SetServer],
  129.                                 [oP_Separator],
  130.                                 [oP_BigText50, 2902, GetServerPath, SetServerPath],
  131.                                 [oP_Separator],
  132.                                 [oP_Text200, 2903, GetUserName, SetUserName],
  133.                                 [oP_Separator],
  134.                                 [oP_Text200, 2904, GetUserCode, SetUserCode],
  135.                                 [oP_Separator],
  136.                                 [oP_Button180, 2601, DoUpload],
  137.                                 [oP_End]
  138.                             ];
  139.     ParameterHeadline    is 2600;
  140.     -----------------------------------------------------------
  141.     PrefsFieldList        is [Server, ServerPath, UserName];
  142.     PrefsNameList        is ["Server", "ServerPath", "UserName"];
  143.     PrefsTypeList        is [void, void, void];
  144.     -----------------------------------------------------------
  145.     WFName                is "UploadTool";
  146.     Version                is 200;
  147.     ValidApplication    is [gWF_Go, gWF_Go_Retail, gWF_Extreme];
  148.     ValidVersion        is [200, 200, 200];
  149.     ValidLicensed        is false;
  150.     Validationcode        is 110247621; -------------
  151.     
  152.     ValidRooms            is [oWF_Upload];
  153.     
  154.     GUIElement            is "./UploadTool.pic";
  155.     GUICells                is 7;
  156.     HelpTextID            is 5023;
  157.     HelpURL                is "./up.htm";
  158. end;
  159.